﻿using DevExpress.Mvvm;
using DevExpress.Mvvm.POCO;
using DevExpress.Mvvm.UI;
using Serilog.Core;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using WpfApp1.Models;

namespace WpfApp1
{
    public class ItemSourceViewModel:ViewModelBase
    {
        public static ItemSourceViewModel Create()
        {
            //这种方式引入了POCO模式
            return ViewModelSource.Create<ItemSourceViewModel>();
        }
        public ItemSourceViewModel()
        {
            MenuList = new ObservableCollection<MenuItemModel>(SimpleData.GetMenuItems());
        }
        public ObservableCollection<MenuItemModel> MenuList
        {
            get { return GetValue<ObservableCollection<MenuItemModel>>(); }
            set { SetValue(value); }
        } 
    }
}
